package com.ostrich.module_player.adapter.provider

import androidx.databinding.DataBindingUtil
import com.chad.library.adapter.base.provider.BaseItemProvider
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.ostrich.module_player.databinding.PlayerItemTitleWhiteViewBinding
import com.ostrich.module_player.databinding.PlayerItemVideoCardWhiteViewBinding
import com.ostrich.module_player.entity.PlayerEntity

/**
 * @Author : yaotianxue
 * @Time : On 2023/11/3 14:52
 * @Description : VideoSmallCardProvider
 */
class VideoSmallCardProvider(override val itemViewType: Int, override val layoutId: Int) :BaseItemProvider<PlayerEntity>() {
    override fun onViewHolderCreated(viewHolder: BaseViewHolder, viewType: Int) {
        DataBindingUtil.bind<PlayerItemVideoCardWhiteViewBinding>(viewHolder.itemView)

    }
    override fun convert(helper: BaseViewHolder, item: PlayerEntity) {
        helper.getBinding<PlayerItemVideoCardWhiteViewBinding>()?.viewModel = item
        helper.getBinding<PlayerItemVideoCardWhiteViewBinding>()?.executePendingBindings()
    }
}